package com.jgp.common.persistence;

import com.jgp.common.pojo.TreeBean;

import javax.persistence.Column;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;

/**
 * 项目   jgp-cloud-parent
 * 作者   loufei
 * 时间   2019-11-01
 */
@MappedSuperclass
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class TreeModel extends LONGModel implements TreeModelStructure {
    
    public TreeModel() {
    }
    
    @Column(name="parent_id")
    private Long parentId;
    
    @Column(name="supers")
    private String supers;
    
    @Column(name="uuid",length = 32)
    private String uuid;
    
    @Column(name="sort")
    private Integer sort;
    
    @Override
    public Long getParentId() {
        return parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    
    @Override
    public String getSupers() {
        return supers;
    }
    
    public void setSupers(String supers) {
        this.supers = supers;
    }
    
    @Override
    public String getUuid() {
        return uuid;
    }
    
    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
    
    public Integer getSort() {
        return sort;
    }
    
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    
    @Override
    public TreeBean mapping() {
        return new TreeBean(getId(), getParentId(), getSupers(), this);
    }
}
